package com.system.weirdor;


import com.system.weirdor.www.config.EnvironmentConfig;
import com.system.weirdor.www.listen.ApplicationReadyEventListener;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;
import org.springframework.scheduling.annotation.EnableScheduling;



/**
 * Created by weirdor on 2017/8/23.
 */
@EnableScheduling
@SpringBootApplication
@EnableElasticsearchRepositories(basePackages = "com.system.weirdor.search.repository")
public class Application extends SpringBootServletInitializer {
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(Application.class);
    }

    public static void main(String[] args) throws Exception {
        System.out.println("***************************************************************");
        System.out.println("启动system-weirdor-www...");

        SpringApplication app = new SpringApplication(Application.class);
        app.setBannerMode(Banner.Mode.OFF);
        app.setAdditionalProfiles(EnvironmentConfig.getActiveProfile());

        app.addListeners(new ApplicationReadyEventListener());

//        PageQuery.DEFAULT_PAGE_SIZE =10 ;
        app.run(args);

    }

}
